*** normal.s	Fri Nov 17 20:10:13 1995
--- tolleuhr.s	Fri Nov 17 20:13:32 1995
***************
*** 14,19 ****
--- 14,27 ----
  
  ***************************************************************************
  
+ 		IFD	_PHXASS_
+ 		machine	68020
+ 		ENDC
+ 
+ 		IFD	SNMA
+ 		mc68020
+ 		ENDC
+ 
  ; include stuff
  
  		include	exec/types.i
***************
*** 226,233 ****
  		lea	92(a2),a0
  		RECALL	GetMsg
  		move.l	d0,WbMsg(bp)
! fromCLI		bsr	main			; call main
! 		move.l	WbMsg(bp),d2
  		beq.s	1$
  		RECALL	Forbid
  		move.l	d2,a1
--- 234,243 ----
  		lea	92(a2),a0
  		RECALL	GetMsg
  		move.l	d0,WbMsg(bp)
! fromCLI		btst	#1,297(a6)
! 		beq.s	2$
! 		bsr	main			; call main
! 2$		move.l	WbMsg(bp),d2
  		beq.s	1$
  		RECALL	Forbid
  		move.l	d2,a1
***************
*** 361,368 ****
  		moveq	#ItemCount-1,d2
  4$		move.b	(a2)+,0(a3)		; type
  		move.b	(a2)+,d0
! 		ext.w	d0
! 		ext.l	d0
  		bmi.s	3$
  		bsr	GetLocStr		; get localized string
  3$		move.l	d0,2(a3)
--- 371,377 ----
  		moveq	#ItemCount-1,d2
  4$		move.b	(a2)+,0(a3)		; type
  		move.b	(a2)+,d0
! 		extb.l	d0
  		bmi.s	3$
  		bsr	GetLocStr		; get localized string
  3$		move.l	d0,2(a3)
***************
*** 881,900 ****
  		beq.s	1$
  6$		moveq	#$40,d0			; while (!CTRL-C && !EndAll) {
  		lsl.w	#6,d0
! 		move.l	WinPort(bp),a1
! 		move.b	15(a1),d1
  		bset	d1,d0
! 		move.l	TimerPort(bp),a1
! 		move.b	15(a1),d1
  		bset	d1,d0
! 		move.l	AudioPort(bp),a1
! 		move.b	15(a1),d1
  		bset	d1,d0
  		move.l	AboutReq(bp),d1
  		beq.s	5$			; no about requester
! 		move.l	d1,a1
! 		move.l	86(a1),a1
! 		move.b	15(a1),d1
  		bset	d1,d0
  5$		CALL	Wait,SysBase(bp)
  		btst	#12,d0			; CTRL-C ?
--- 890,904 ----
  		beq.s	1$
  6$		moveq	#$40,d0			; while (!CTRL-C && !EndAll) {
  		lsl.w	#6,d0
! 		move.b	([WinPort,bp],15),d1
  		bset	d1,d0
! 		move.b	([TimerPort,bp],15),d1
  		bset	d1,d0
! 		move.b	([AudioPort,bp],15),d1
  		bset	d1,d0
  		move.l	AboutReq(bp),d1
  		beq.s	5$			; no about requester
!  		move.b	([86,d1.l],15),d1
  		bset	d1,d0
  5$		CALL	Wait,SysBase(bp)
  		btst	#12,d0			; CTRL-C ?
***************
*** 1237,1244 ****
  		moveq	#$40,d0			; GADGETUP
  		cmp.l	d0,d2
  		bne.s	1$
! 		move.l	color(bp),a0
! 		move.b	d3,0(a0)		; set new color
  		bsr	SetPattern
  		bsr	Rahmen
  		bsr	ZifferBlatt
--- 1241,1247 ----
  		moveq	#$40,d0			; GADGETUP
  		cmp.l	d0,d2
  		bne.s	1$
! 		move.b	d3,([color,bp])		; set new color
  		bsr	SetPattern
  		bsr	Rahmen
  		bsr	ZifferBlatt
***************
*** 1256,1263 ****
  		cmp.l	d1,d2
  		beq.s	msgRefresh		; CASE REFRESHWINDOW
  		moveq	#($100>>2),d1
! 		add.w	d1,d1
! 		add.w	d1,d1
  		cmp.l	d1,d2
  		beq.s	msgMenuPick		; CASE MENUPICK
  		add.l	d1,d1
--- 1259,1265 ----
  		cmp.l	d1,d2
  		beq.s	msgRefresh		; CASE REFRESHWINDOW
  		moveq	#($100>>2),d1
! 		lsl.w	#2,d1
  		cmp.l	d1,d2
  		beq.s	msgMenuPick		; CASE MENUPICK
  		add.l	d1,d1
***************
*** 1327,1340 ****
  		move.w	32(a2),d3
  		moveq	#$1f,d0
  		and.w	d2,d0			; MENUNUM
- 		add.w	d0,d0			; now index !
  		move.w	d2,d1
  		lsr.w	#5,d1
  		andi.w	#$3f,d1			; ITEMNUM
  		lsr.w	#8,d2
  		lsr.w	#3,d2
  		andi.w	#$1f,d2			; SUBNUM
! 		move.w	menuTab(pc,d0.w),d0
  		jsr	menuTab(pc,d0.w)	; execute CASE
  		bsr	msgNewSize
  		bne.s	msgMenuPick		; no error !
--- 1329,1341 ----
  		move.w	32(a2),d3
  		moveq	#$1f,d0
  		and.w	d2,d0			; MENUNUM
  		move.w	d2,d1
  		lsr.w	#5,d1
  		andi.w	#$3f,d1			; ITEMNUM
  		lsr.w	#8,d2
  		lsr.w	#3,d2
  		andi.w	#$1f,d2			; SUBNUM
! 		move.w	menuTab(pc,d0.w*2),d0
  		jsr	menuTab(pc,d0.w)	; execute CASE
  		bsr	msgNewSize
  		bne.s	msgMenuPick		; no error !
***************
*** 1347,1354 ****
  
  ;--------------------------------------------------------------------------
  
! menuProject	add.w	d1,d1			; now index !
! 		move.w	projectTab(pc,d1.w),d1
  		jmp	projectTab(pc,d1.w)
  
  projectTab	ADDCMD	project,About,0
--- 1348,1354 ----
  
  ;--------------------------------------------------------------------------
  
! menuProject	move.w	projectTab(pc,d1.w*2),d1
  		jmp	projectTab(pc,d1.w)
  
  projectTab	ADDCMD	project,About,0
***************
*** 1381,1388 ****
  
  ;--------------------------------------------------------------------------
  
! menuSettings	add.w	d1,d1			; now index !
! 		move.w	settingsTab(pc,d1.w),d1
  		moveq	#1,d0
  		and.b	12(a2),d0		; checked=item.Flags&CHECKED;
  		jmp	settingsTab(pc,d1.w)
--- 1381,1387 ----
  
  ;--------------------------------------------------------------------------
  
! menuSettings	move.w	settingsTab(pc,d1.w*2),d1
  		moveq	#1,d0
  		and.b	12(a2),d0		; checked=item.Flags&CHECKED;
  		jmp	settingsTab(pc,d1.w)
***************
*** 1633,1640 ****
  10$		lea	RPort2(bp),a1
  		CALL	InitRastPort,GfxBase(bp)
  		moveq	#0,d0
! 		move.l	PubScreen(bp),a0
! 		move.b	189(a0),d0		; BitMap.Depth
  		move.l	Breit2(bp),d1
  		move.l	Hoehe2(bp),d2
  		lea	BitMap1(bp),a0
--- 1632,1638 ----
  10$		lea	RPort2(bp),a1
  		CALL	InitRastPort,GfxBase(bp)
  		moveq	#0,d0
! 		move.b	([PubScreen,bp],189),d0	; BitMap.Depth
  		move.l	Breit2(bp),d1
  		move.l	Hoehe2(bp),d2
  		lea	BitMap1(bp),a0
***************
*** 1689,1695 ****
  		bne.s	1$
  		move.l	d2,d0
  		moveq	#60,d1
! 		bsr	LDiv			; sec = 59-sec%60
  		moveq	#59,d0
  		sub.l	d1,d0
  1$		move.l	d0,32(a2)		; tv_secs
--- 1687,1693 ----
  		bne.s	1$
  		move.l	d2,d0
  		moveq	#60,d1
! 		divul.l	d1,d1:d0		; sec = 59-sec%60
  		moveq	#59,d0
  		sub.l	d1,d0
  1$		move.l	d0,32(a2)		; tv_secs
***************
*** 1700,1721 ****
  		move.w	min(bp),d4		; oldmin
  		move.l	d2,d0
  		moveq	#60,d1
! 		bsr	LDiv			; min = sec/60
  		exg.l	d0,d2
  		moveq	#60,d1
! 		bsr	LDiv			; sec = sec%60
  		move.w	d1,sec(bp)
  		move.l	d2,d0
  		moveq	#12,d1
! 		bsr	LDiv			; std = min/12
  		move.l	d0,d3
  		move.l	d2,d0
  		moveq	#60,d1
! 		bsr	LDiv			; min = min%60
  		move.w	d1,min(bp)
  		move.l	d3,d0
  		moveq	#60,d1
! 		bsr	LDiv			; std = std%60
  		move.w	d1,std(bp)
  		move.w	min(bp),d0
  		sub.w	d4,d0			; oldmin != min
--- 1698,1719 ----
  		move.w	min(bp),d4		; oldmin
  		move.l	d2,d0
  		moveq	#60,d1
! 		divul.l	d1,d1:d0		; min = sec/60
  		exg.l	d0,d2
  		moveq	#60,d1
! 		divul.l	d1,d1:d0		; sec = sec%60
  		move.w	d1,sec(bp)
  		move.l	d2,d0
  		moveq	#12,d1
! 		divul.l	d1,d1:d0		; std = min/12
  		move.l	d0,d3
  		move.l	d2,d0
  		moveq	#60,d1
! 		divul.l	d1,d1:d0		; min = min%60
  		move.w	d1,min(bp)
  		move.l	d3,d0
  		moveq	#60,d1
! 		divul.l	d1,d1:d0		; std = std%60
  		move.w	d1,std(bp)
  		move.w	min(bp),d0
  		sub.w	d4,d0			; oldmin != min
***************
*** 1724,1731 ****
  
  ;--------------------------------------------------------------------------
  
! SetAPen		ext.w	d0			; set pen
! 		ext.l	d0
  		move.l	a2,a1
  		jmp	_LVOSetAPen(a6)
  
--- 1722,1728 ----
  
  ;--------------------------------------------------------------------------
  
! SetAPen		extb.l	d0			; set pen
  		move.l	a2,a1
  		jmp	_LVOSetAPen(a6)
  
***************
*** 1932,1943 ****
  6$		move.l	d4,d0
  		moveq	#100,d1
  		add.w	d1,d1
! 		bsr	LDiv
  		move.l	d0,0(sp)		; Breit2/200
  		move.l	d5,d0
  		moveq	#100,d1
  		add.w	d1,d1
! 		bsr	LDiv
  		move.l	d0,4(sp)		; Hoehe2/200
  		move.l	d2,d0
  		add.l	0(sp),d0
--- 1929,1940 ----
  6$		move.l	d4,d0
  		moveq	#100,d1
  		add.w	d1,d1
! 		divul.l	d1,d1:d0
  		move.l	d0,0(sp)		; Breit2/200
  		move.l	d5,d0
  		moveq	#100,d1
  		add.w	d1,d1
! 		divul.l	d1,d1:d0
  		move.l	d0,4(sp)		; Hoehe2/200
  		move.l	d2,d0
  		add.l	0(sp),d0
***************
*** 1957,1968 ****
  		bsr	AreaDraw
  		bra.s	4$
  5$		swap	d0			; else { draw hour }
! 		lea	dx1(pc),a3
! 		lea	0(a3,d0.w),a3		; calc table entry
! 		lea	pent(pc),a0
! 		move.b	0(a0,d0.w),d0
! 		lea	Pens(bp),a0
! 		move.b	0(a0,d0.w),d0
  		bsr	SetPens			; set apen + open
  		bsr	MoveHour
  		bsr	DrawHour
--- 1954,1962 ----
  		bsr	AreaDraw
  		bra.s	4$
  5$		swap	d0			; else { draw hour }
! 		lea	(dx1,pc,d0.w),a3
! 		move.b	(pent,pc,d0.w),d0
! 		move.b	(Pens,bp,d0.w),d0
  		bsr	SetPens			; set apen + open
  		bsr	MoveHour
  		bsr	DrawHour
***************
*** 2047,2054 ****
  
  SetOPen		cmpi.w	#39,20(a6)		; SetOPen v39+
  		bcs.s	1$
! 		ext.w	d0
! 		ext.l	d0
  		move.l	a2,a0
  		jmp	_LVOSetOutlinePen(a6)
  1$		move.b	d0,27(a2)		; SetOPen pre v39+
--- 2041,2047 ----
  
  SetOPen		cmpi.w	#39,20(a6)		; SetOPen v39+
  		bcs.s	1$
! 		extb.l	d0
  		move.l	a2,a0
  		jmp	_LVOSetOutlinePen(a6)
  1$		move.b	d0,27(a2)		; SetOPen pre v39+
***************
*** 2064,2074 ****
  		lea	RPort2(bp),a2
  		move.l	Breit2(bp),d2
  		move.l	Hoehe2(bp),d3
- 		lea	handwidth(pc),a1
  		moveq	#0,d1
  		move.b	zeigerbreite(bp),d1
! 		add.w	d1,d1
! 		move.w	0(a1,d1.w),d1
  		lea	sinus(pc),a0
  		adda.w	0(a3),a0
  		move.b	60(a0),d7		; y2
--- 2057,2065 ----
  		lea	RPort2(bp),a2
  		move.l	Breit2(bp),d2
  		move.l	Hoehe2(bp),d3
  		moveq	#0,d1
  		move.b	zeigerbreite(bp),d1
! 		move.w	(handwidth,pc,d1.w*2),d1
  		lea	sinus(pc),a0
  		adda.w	0(a3),a0
  		move.b	60(a0),d7		; y2
***************
*** 2109,2116 ****
  		move.b	zeigertyp(bp),d0
  		beq.s	1$
  		pea	AreaEnd(pc)		; last area cmd
! 		add.w	d0,d0
! 1$		move.w	ZeigerTab(pc,d0.w),d0
  		jmp	ZeigerTab(pc,d0.w)
  
  ZeigerTab	ADDCMD	Zeiger,0,0		; case line
--- 2100,2106 ----
  		move.b	zeigertyp(bp),d0
  		beq.s	1$
  		pea	AreaEnd(pc)		; last area cmd
! 1$		move.w	ZeigerTab(pc,d0.w*2),d0
  		jmp	ZeigerTab(pc,d0.w)
  
  ZeigerTab	ADDCMD	Zeiger,0,0		; case line
***************
*** 2440,2453 ****
  		subq.w	#4,a2			; ttypes[k]
  		move.l	d5,a3			; buffer for sprintf
  		moveq	#0,d0			; TOP
- 		move.l	WinPtr(bp),a1
  		moveq	#0,d1
! 		move.w	6(a1),d1		; window->TopEdge
  		bsr	SetToolType
  		moveq	#1,d0			; LEFT
- 		move.l	WinPtr(bp),a1
  		moveq	#0,d1
! 		move.w	4(a1),d1		; window->LeftEdge
  		bsr	SetToolType
  		moveq	#2,d0			; WIDTH
  		move.l	Breite(bp),d1
--- 2430,2441 ----
  		subq.w	#4,a2			; ttypes[k]
  		move.l	d5,a3			; buffer for sprintf
  		moveq	#0,d0			; TOP
  		moveq	#0,d1
! 		move.w	([WinPtr,bp],6),d1	; window->TopEdge
  		bsr	SetToolType
  		moveq	#1,d0			; LEFT
  		moveq	#0,d1
! 		move.w	([WinPtr,bp],4),d1	; window->LeftEdge
  		bsr	SetToolType
  		moveq	#2,d0			; WIDTH
  		move.l	Breite(bp),d1
***************
*** 2553,2560 ****
  		rts
  
  GetToolType	lea	tt_Tab(pc),a0		; get ptr to tooltype
! 		add.w	d0,d0
! 		adda.w	0(a0,d0.w),a0
  		rts
  
  SetStr		move.l	-4(a2),a3		; make a string
--- 2541,2547 ----
  		rts
  
  GetToolType	lea	tt_Tab(pc),a0		; get ptr to tooltype
! 		adda.w	0(a0,d0.w*2),a0
  		rts
  
  SetStr		move.l	-4(a2),a3		; make a string
***************
*** 2612,2619 ****
  		tst.b	smarthour(bp)
  		beq.s	3$
  		moveq	#24*2,d0
! 		add.w	d3,d3
! 		add.w	d3,d3
  		sub.w	d3,d0
  		bra.s	3$
  ; if (chime==2 && (min==15 || min==30 || min==45))
--- 2599,2605 ----
  		tst.b	smarthour(bp)
  		beq.s	3$
  		moveq	#24*2,d0
! 		lsl.w	#2,d3
  		sub.w	d3,d0
  		bra.s	3$
  ; if (chime==2 && (min==15 || min==30 || min==45))
***************
*** 2689,2696 ****
  		bsr.s	EndTune			; free channels
  3$		bra.s	1$
  2$		st	0(a1,d1.w)		; audsent[reqnr]=1;
! 		add.w	d1,d1
! 		add.w	d1,d1
  		lea	AudioIO+0(bp),a1
  		move.l	0(a1,d1.w),a1
  		move.w	#3,28(a1)		; io_Command = CMD_WRITE;
--- 2675,2681 ----
  		bsr.s	EndTune			; free channels
  3$		bra.s	1$
  2$		st	0(a1,d1.w)		; audsent[reqnr]=1;
! 		lsl.w	#2,d1
  		lea	AudioIO+0(bp),a1
  		move.l	0(a1,d1.w),a1
  		move.w	#3,28(a1)		; io_Command = CMD_WRITE;
***************
*** 2744,2751 ****
  		clr.w	NewGad+16(bp)		; clear gadget id
  		move.b	(a3)+,d4		; gadget counter
  4$		lea	NewGad(bp),a2		; structure to fill
! 		move.l	WinPtr(bp),a0
! 		move.l	46(a0),a0		; screen
  		moveq	#0,d0			; LeftEdge
  		move.b	(a3)+,d0
  		add.b	36(a0),d0		; screen->WBorLeft;
--- 2729,2735 ----
  		clr.w	NewGad+16(bp)		; clear gadget id
  		move.b	(a3)+,d4		; gadget counter
  4$		lea	NewGad(bp),a2		; structure to fill
! 		move.l	([WinPtr,bp],46),a0	; screen
  		moveq	#0,d0			; LeftEdge
  		move.b	(a3)+,d0
  		add.b	36(a0),d0		; screen->WBorLeft;
***************
*** 2816,2824 ****
  
  GetLocStr	move.l	a6,-(sp)		; get localized string
  		lea	LocaleTab(pc),a1
! 		add.w	d0,d0
! 		add.w	0(a1,d0.w),a1		; default !
! 		lsr.w	#1,d0
  		move.l	Catalog(bp),d1
  		beq.s	1$			; no catalog !
  		move.l	d1,a0
--- 2800,2806 ----
  
  GetLocStr	move.l	a6,-(sp)		; get localized string
  		lea	LocaleTab(pc),a1
! 		add.w	0(a1,d0.w*2),a1		; default !
  		move.l	Catalog(bp),d1
  		beq.s	1$			; no catalog !
  		move.l	d1,a0
***************
*** 2913,2940 ****
  
  ***************************************************************************
  
- ; 32-bit division (only positive values!)
- 
- LDiv		move.l	d3,-(sp)
- 		move.l	d2,-(sp)
- 		move.w	d1,d3
- 		move.w	d0,d2
- 		clr.w	d0
- 		swap	d0
- 		divu.w	d3,d0
- 		move.l	d0,d1
- 		swap	d0
- 		move.w	d2,d1
- 		divu.w	d3,d1
- 		move.w	d1,d0
- 		clr.w	d1
- 		swap	d1
- 		move.l	(sp)+,d2
- 		move.l	(sp)+,d3
- 		rts
- 
- ***************************************************************************
- 
  ; static data
  
  GadgetList	dc.b	$03,$80			; GTYP_CLOSE
--- 2895,2900 ----
***************
*** 3253,3259 ****
  linefeed	dc.b	10,0
  
  		dc.b	'$VER: '
! ProgName	dc.b	'TolleUhr 1.3 (18.5.95) by M.Fleischer and G.Nikl in 1993/95',0
  
  fmt1		dc.b	'%s=%ld',0		; format templates for tooltypes
  fmt2		dc.b	'%s',0
--- 3213,3219 ----
  linefeed	dc.b	10,0
  
  		dc.b	'$VER: '
! ProgName	dc.b	'TolleUhr [020] 1.3 (18.5.95) by M.Fleischer and G.Nikl in 1993/95',0
  
  fmt1		dc.b	'%s=%ld',0		; format templates for tooltypes
  fmt2		dc.b	'%s',0
